import { file } from 'jszip'
import request, { downLoadExcel, downLoadZip} from './request'

//登录
export function login(data) {
  return request({
    url: '/admin/login',
    method: 'post',
    data,
  })
}
//首页
export function welcome(data) {
  return request({
    url: '/admin/index/welcome',
    method: 'get',
    params: data,
  })
}
//首页表格数据
export function getecharts(data) {
  return request({
    url: '/admin/equipment.info_log/echarts',
    method: 'get',
    params: data,
  })
}
//首页表格数据单个
export function getechartsByid(data) {
  return request({
    url: '/admin/equipment.info_log/equipmentEchartsById',
    method: 'get',
    params: data,
  })
}
//首页设备下拉
export function equipmentSelected(data) {
  return request({
    url: '/admin/equipment.info_log/equipmentList',
    method: 'get',
    params: data,
  })
}
//首页表格数据
export function downloadLog(data) {
  return downLoadExcel('/admin/equipment.info_log/export', data, data['filename'])
}
//首页表格数据
export function downloadLog2(data) {
  return downLoadExcel('/admin/equipment.info_log/exportAll', data, data['filename'])
}
//管理员列表
export function system(data) {
  return request({
    url: '/admin/system.admin/index',
    method: 'get',
    params: data,
  })
}
//新增管理员
export function systemAdd(data) {
  return request({
    url: '/admin/system.admin/add',
    method: 'post',
    data,
  })
}
//编辑管理员
export function systemEdit(data) {
  return request({
    url: '/admin/system.admin/edit',
    method: 'post',
    data,
  })
}
//编辑管理员
export function validateUser(data) {
  return request({
    url: '/admin/system.admin/validateuser',
    method: 'post',
    data,
  })
}

//删除管理员
export function systemDelete(data) {
  return request({
    url: '/admin/system.admin/delete',
    method: 'post',
    data,
  })
}
//权限列表
export function authList(data) {
  return request({
    url: '/admin/system.admin/getAuthList',
    method: 'get',
    params: data,
  })
}

//权限列表
export function systemAuth(data) {
  return request({
    url: '/admin/system.auth/index',
    method: 'get',
    params: data,
  })
}
//添加权限
export function addAuth(data) {
  return request({
    url: '/admin/system.auth/add',
    method: 'post',
    data,
  })
}
//编辑权限
export function editAuth(data) {
  return request({
    url: '/admin/system.auth/edit',
    method: 'post',
    data,
  })
}
//删除权限
export function deleteAuth(data) {
  return request({
    url: '/admin/system.auth/delete',
    method: 'post',
    data,
  })
}
//授权列表
export function authorize(data) {
  return request({
    url: '/admin/system.auth/authorize',
    method: 'get',
    params: data,
  })
}
//授权列表
export function saveAuthorize(data) {
  return request({
    url: '/admin/system.auth/saveAuthorize',
    method: 'post',
    data,
  })
}

//日志
export function systemLog(data) {
  return request({
    url: '/admin/system.log/index',
    method: 'get',
    params: data,
  })
}

// 医院列表
export function platformList(data) {
  return request({
    url: '/admin/platform.info/index',
    method: 'get',
    params: data,
  })
}
// 添加医院
export function addPlatform(data) {
  return request({
    url: '/admin/platform.info/add',
    method: 'post',
    data,
  })
}
// 编辑医院
export function editPlatform(data) {
  return request({
    url: '/admin/platform.info/edit',
    method: 'post',
    data,
  })
}
// 删除医院
export function deletePlatform(data) {
  return request({
    url: '/admin/platform.info/delete',
    method: 'post',
    data,
  })
}
// 图片上传
export function uploadFun(data) {
  return request({
    url: '/admin/util.Tool/uploadFun',
    method: 'post',
    data,
  })
}

// 系统节点
export function nodeList(data) {
  return request({
    url: '/admin/system.node/index',
    method: 'get',
    params: data,
  })
}
// 节点开关
export function modify(data) {
  return request({
    url: '/admin/system.node/modify',
    method: 'post',
    data,
  })
}
// 更新节点
export function refreshNode(data) {
  return request({
    url: '/admin/system.node/refreshNode',
    method: 'post',
    data,
  })
}
// 清除失效节点
export function clearNode(data) {
  return request({
    url: '/admin/system.node/clearNode',
    method: 'post',
    data,
  })
}

// 系统参数
export function configList(data) {
  return request({
    url: '/admin/system.config/index',
    method: 'get',
    params: data,
  })
}
// 编辑系统参数
export function saveConfig(data) {
  return request({
    url: '/admin/system.config/save',
    method: 'post',
    data,
  })
}

// 科室列表
export function departmentList(data) {
  return request({
    url: '/admin/platform.department/index',
    method: 'get',
    params: data,
  })
}

// 人员设备列表
export function PersonnelQuipmentList(data) {
  return request({
    url: '/admin/personnel.quipment/index',
    method: 'get',
    params: data,
  })
}

// 添加科室
export function addDept(data) {
  return request({
    url: '/admin/platform.department/add',
    method: 'post',
    data,
  })
}
// 修改列表
export function editDept(data) {
  return request({
    url: '/admin/platform.department/edit',
    method: 'post',
    data,
  })
}
// 删除列表
export function deleteDept(data) {
  return request({
    url: '/admin/platform.department/delete',
    method: 'post',
    data,
  })
}

// 房间列表
export function roomList(data) {
  return request({
    url: '/admin/platform.room/index',
    method: 'get',
    params: data,
  })
}
// 添加房间
export function addRoom(data) {
  return request({
    url: '/admin/platform.room/add',
    method: 'post',
    data,
  })
}
// 编辑房间
export function editRoom(data) {
  return request({
    url: '/admin/platform.room/edit',
    method: 'post',
    data,
  })
}
// 删除房间
export function deleteRoom(data) {
  return request({
    url: '/admin/platform.room/delete',
    method: 'post',
    data,
  })
}

// 人员列表
export function personnelList(data) {
  return request({
    url: '/admin/platform.personnel/index',
    method: 'get',
    params: data,
  })
}
// 添加人员
export function addPersonnel(data) {
  return request({
    url: '/admin/platform.personnel/add',
    method: 'post',
    data,
  })
}
// 编辑人员
export function editPersonnel(data) {
  return request({
    url: '/admin/platform.personnel/edit',
    method: 'post',
    data,
  })
}
// 删除人员
export function deletePersonnel(data) {
  return request({
    url: '/admin/platform.personnel/delete',
    method: 'post',
    data,
  })
}

export function selectListArray(data) {
  return request({
    url: '/admin/platform.department/selectListArray',
    method: 'get',
    params: data,
  })
}

// 设备平台 列表
export function equipment(data) {
  return request({
    url: '/admin/equipment.platform/index',
    method: 'get',
    params: data,
  })
}
// 新增设备平台
export function addEquipment(data) {
  return request({
    url: '/admin/equipment.platform/add',
    method: 'post',
    data,
  })
}
// 编辑设备平台
export function editEquipment(data) {
  return request({
    url: '/admin/equipment.platform/edit',
    method: 'post',
    data,
  })
}
// 删除设备平台
export function deleteEquipment(data) {
  return request({
    url: '/admin/equipment.platform/delete',
    method: 'post',
    data,
  })
}

// 设备列表
export function equipInfo(data) {
  return request({
    url: '/admin/equipment.info/index',
    method: 'get',
    params: data,
  })
}
// 新增设备
export function addEquipInfo(data) {
  return request({
    url: '/admin/equipment.info/add',
    method: 'post',
    data,
  })
}
// 编辑设备
export function editEquipInfo(data) {
  return request({
    url: '/admin/equipment.info/edit',
    method: 'post',
    data,
  })
}
// 删除设备
export function deleteEquipInfo(data) {
  return request({
    url: '/admin/equipment.info/delete',
    method: 'post',
    data,
  })
}

// 设备日志
export function InfoLog(data) {
  return request({
    url: '/admin/equipment.InfoLog/index',
    method: 'get',
    params: data,
  })
}

// 菜单
export function menu(data) {
  return request({
    url: '/admin/system.menu/index',
    method: 'get',
    params: data,
  })
}
// 添加菜单
export function addMenu(data) {
  return request({
    url: '/admin/system.menu/add',
    method: 'post',
    data,
  })
}
// 编辑菜单
export function editMenu(data) {
  return request({
    url: '/admin/system.menu/edit',
    method: 'post',
    data,
  })
}
export function modifyMenu(data) {
  return request({
    url: '/admin/system.menu/modify',
    method: 'post',
    data,
  })
}
// 编辑菜单
export function deleteMenu(data) {
  return request({
    url: '/admin/system.menu/delete',
    method: 'post',
    data,
  })
}

// 房间人员
export function roomPerso(data) {
  return request({
    url: '/admin/platform.RoomPersonnel/index',
    method: 'get',
    params: data,
  })
}
// 添加房间人员
export function addRoomPerso(data) {
  return request({
    url: '/admin/platform.RoomPersonnel/add',
    method: 'post',
    data,
  })
}
// 编辑房间人员
export function editRoomPerso(data) {
  return request({
    url: '/admin/platform.RoomPersonnel/edit',
    method: 'post',
    data,
  })
}
// 删除房间人员
export function deleteRoomPerso(data) {
  return request({
    url: '/admin/platform.RoomPersonnel/delete',
    method: 'post',
    data,
  })
}

export function menuorize(data) {
  return request({
    url: '/admin/system.auth/menuorize',
    method: 'get',
    params: data,
  })
}
export function saveMenu(data) {
  return request({
    url: '/admin/system.auth/saveMenu',
    method: 'post',
    data,
  })
}
export function adminmenu(data) {
  return request({
    url: '/admin/system.menu/adminmenu',
    method: 'get',
    params: data,
  })
}
//修改密码
export function editPassword(data) {
  return request({
    url: '/admin/index/editPassword',
    method: 'post',
    data,
  })
}
export function quipmentList(data) {
  return request({
    url: '/admin/personnel.quipment/index',
    method: 'get',
    params: data,
  })
}
export function addQuipment(data) {
  return request({
    url: '/admin/personnel.quipment/add',
    method: 'post',
    data,
  })
}
export function editQuipment(data) {
  return request({
    url: '/admin/personnel.quipment/edit',
    method: 'post',
    data,
  })
}
export function delQuipment(data) {
  return request({
    url: '/admin/personnel.quipment/delete',
    method: 'post',
    data,
  })
}
export function noIndexRoom(data) {
  return request({
    url: '/admin/equipment.info/noIndexRoom',
    method: 'get',
    params: data,
  })
}
export function importEquipment(data) {
  return request({
    url: '/admin/equipment.info/import',
    method: 'post',
    data,
  })
}
//分配设备
export function bindplat(data) {
  return request({
    url: '/admin/equipment.info/bindplat',
    method: 'post',
    data,
  })
}
//设备在线状态
export function onlinestatus(data) {
  return request({
    url: '/admin/equipment.info/onlinestatus',
    method: 'get',
    params: data,
  })
}

//帮助中心-列表
export function helperIndex(data) {
  return request({
    url: '/admin/helper.info/index',
    method: 'get',
    params: data,
  })
}
//帮助中心-新增
export function helperAdd(data) {
  return request({
    url: '/admin/helper.info/add',
    method: 'post',
    data,
  })
}
//帮助中心-编辑
export function getHelperEdit(data) {
  return request({
    url: '/admin/helper.info/edit',
    method: 'get',
    params: data,
  })
}
//帮助中心-编辑
export function helperEdit(data) {
  return request({
    url: '/admin/helper.info/edit',
    method: 'post',
    data,
  })
}
//帮助中心-删除
export function helperDelete(data) {
  return request({
    url: '/admin/helper.info/delete',
    method: 'post',
    data,
  })
}

//设备报损-列表
export function damagedIndex(data) {
  return request({
    url: '/admin/equipment.damaged/index',
    method: 'get',
    params: data,
  })
}
//设备报损-新增
export function damagedAdd(data) {
  return request({
    url: '/admin/equipment.damaged/add',
    method: 'post',
    data,
  })
}
//设备报损-编辑
export function damagedEdit(data) {
  return request({
    url: '/admin/equipment.damaged/edit',
    method: 'post',
    data,
  })
}
//设备报损-删除
export function damagedDelete(data) {
  return request({
    url: '/admin/equipment.damaged/delete',
    method: 'post',
    data,
  })
}
//设备报损-编辑
export function damagedModify(data) {
  return request({
    url: '/admin/equipment.damaged/modify',
    method: 'post',
    data,
  })
}

// 站内信息-列表
export function msgList(data) {
  return request({
    url: '/admin/message.info/index',
    method: 'get',
    params: data,
  })
}
// 站内信息-添加
export function msgAdd(data) {
  return request({
    url: '/admin/message.info/add',
    method: 'post',
    data,
  })
}
// 站内信息-编辑
export function msgEdit(data) {
  return request({
    url: '/admin/message.info/edit',
    method: 'post',
    data,
  })
}
// 站内信息-删除
export function msgDelete(data) {
  return request({
    url: '/admin/message.info/delete',
    method: 'post',
    data,
  })
}

// 编辑设备配置
export function editEquiSetting(data) {
  return request({
    url: '/admin/equipment.setting/edit',
    method: 'post',
    data,
  })
}
// 导出设备检测报告
export function exportEquipment(data) {
  return request({
    url: '/admin/equipment.detection/export',
    method: 'post',
    data,
  })
}
// 导出设备检测报告

export function exportEquipmentzip(data) {
  return downLoadZip('/admin/equipment.detection/zip', data, data['year'])
}

// 数据大屏
export function baseData(data) {
  return request({
    url: '/admin/platform.datadisplay/baseData',
    method: 'get',
    params: data,
  })
}
// 异常日志
export function logList(data) {
  return request({
    url: '/admin/platform.datadisplay/logList',
    method: 'get',
    params: data,
  })
}
// 图表
export function dataEcharts(data) {
  return request({
    url: '/admin/platform.datadisplay/dataEcharts',
    method: 'get',
    params: data,
  })
}
